<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>在线留言</title>
	<link rel="stylesheet" href="__PLUGIN__/layui/css/layui.css">
	<link rel="stylesheet" href="__CSS__/zaixianliuyan.css">
	<style>
	 	html,body,.container{
            min-width: 1200px;
        }
		.layui-nav .layui-nav-more{
			display: none;
		}
		.layui-bg-blue{
			background: #177cc6!important;
		}
		.swiper-pagination-bullet{
			width: 18px;
			height: 18px;
		}
		.layui-form-item .layui-input-inline{
			width: 300px;
		}
	</style>
</head>
<body>
	<div class="container">
		{include file="header"/}
		{include file="nav"/}
		<div class="banner">
			<img src="__IMG__/banner1.jpg" alt="">
		</div>
		<div class="main">
			<div class="main_top">
				<h1><i class="layui-icon" style="font-size:24px; color: #1E9FFF;">&#xe609;</i>&nbsp;&nbsp;在线留言</h1>
			</div>
			<div class="main_cont">
				<p>我们将采取有效的方式保护您的个人信息。您所提供的信息将有助于我们为您提供更好的服务。</p>
				<form class="layui-form" action="javascript:;">
					<input type="hidden" name="__token__" value="{$token}" />
				  	<div class="layui-form-item">
					    <label class="layui-form-label">姓名：</label>
					    <div class="layui-input-inline">
					      	<input type="text" name="name" lay-verify="name" autocomplete="off" placeholder="请输入姓名(必填)" class="layui-input">
					    </div>
				 	</div>
				  	<div class="layui-form-item">
				  		<label class="layui-form-label">手机号：</label>
				     	<div class="layui-input-inline">
				        	<!-- <input type="tel" name="phone" lay-verify="required|phone" autocomplete="off" placeholder="请输入手机号" class="layui-input"> -->
				        	<input type="tel" name="phone" autocomplete="off" placeholder="请输入手机号" class="layui-input">
				      	</div>
				 	 </div>
				  	<div class="layui-form-item">
					    <label class="layui-form-label">联系地址：</label>
					    <div class="layui-input-inline">
					      <input type="text" name="address" placeholder="请输入地址" autocomplete="off" class="layui-input">
					    </div>
				 	 </div>
				  	<div class="layui-form-item">
				    	<label class="layui-form-label">您的邮箱：</label>
					    <div class="layui-input-inline">
					        <input type="text" name="email" lay-verify="email" placeholder="请输入邮箱(必填)" autocomplete="off" class="layui-input">
					    </div>
					    <!-- <div class="layui-form-mid layui-word-aux"><span style="color: red;">*</span></div> -->
				  	</div>
					<div class="layui-form-item layui-form-text">
					    <label class="layui-form-label">反馈内容：</label>
					    <div class="layui-input-block">
					      	<textarea placeholder="请输入内容(必填)" class="layui-textarea" name="content"></textarea>
					    </div>
					</div>
				 
				  	<div class="layui-form-item">
					    <div class="layui-input-block">
					     	<button class="layui-btn" lay-submit="" lay-filter="sub_btn">立即提交</button>
					     	<button type="reset" class="layui-btn layui-btn-primary">重置</button>
					    </div>
				  	</div>
				</form>
			</div>
		</div>
		{include file="footer"/}
	</div>
<script type="text/javascript" src="__PLUGIN__/layui/layui.js"></script>	
<script>
	layui.use(['element', 'form', 'layedit', 'jquery', 'laydate'], function(){
		var form = layui.form
			,element = layui.element	//导航的hover效果、二级菜单等功能，需要依赖element模块
			,layer = layui.layer
			,layedit = layui.layedit
			,$ = layui.jquery
			,laydate = layui.laydate;
		
		//监听导航点击
	  	element.on('nav(demo)', function(elem){
	    	layer.msg(elem.text());
	  	});

	  	//自定义验证规则
	  	form.verify({
	    	name: function(value){
	      		if(value.length < 2){
	        		return '请填写姓名且不少于两个字符';
	      		}
	    	}
	    	,content: function(value){
	      		layedit.sync(editIndex);
	    	}
	  	});
	  
	  	//监听提交
	  	form.on('submit(sub_btn)', function(data){
	    	var url = "{:url('index/message')}";
	    	$.post(url, data.field, function(res) {
	    		console.log(res);
                if (res.status == 1 && res.message=="令牌数据无效") {
                	layer.msg("表单数据已过期, 请刷新页面重新填写");
                	return;
                } else {
                	layer.msg(res.message);
                	return;
                }

            },"JSON");
	    	return false;
	  	});
	});
</script>
</body>
</html>